package com.fenxiangle.yueding.feature.message.view;

import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.common.util.DateTool;
import com.fenxiangle.yueding.entity.bo.MsgBo;

import butterknife.BindView;

public class OrderMsgAdapter extends BaseQuickAdapter<MsgBo, BaseViewHolder> {
  int type;

    public OrderMsgAdapter( int type) {
        super(R.layout.item_order_message);
        this.type=type;
    }

    @Override
    protected void convert(BaseViewHolder helper, MsgBo item) {
        helper.setText(R.id.tv_msg_name, item.getTitle())
                .setText(R.id.tv_msg_date, DateTool.formatTime4(item.getCreateTime()))
                .setText(R.id.tv_msg_content, item.getContent())
                .setText(R.id.tv_msg_order_no, "订单编号：" + item.getOrderId());
        if (type==1){
            helper.getView(R.id.tv_msg_order_no).setVisibility(View.GONE);
        }
    }
}
